import React from 'react';

const Dashboard = () => {
  const handleLogout = () => {
    localStorage.removeItem('token');
    window.location.href = '/login';
  };

  return (
    <div>
      <h1>仪表盘</h1>
      <p>这是需要登录才能访问的页面</p>
      <button onClick={handleLogout}>退出登录</button>
    </div>
  );
};

export default Dashboard;